package com.itqf.springboot_mvc.controller;

import com.itqf.springboot_mvc.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * projectName: qk_javaproject
 *
 * @author: 肖成扬
 * time: 2021/9/8 14:52
 * description:第一个contrller，handler
 */
@ResponseBody
@Controller
@RequestMapping("user")
public class IndexController {

    @RequestMapping("hello")
    public Object hello(){
        return "hello world!";
    }
    @PostMapping("login" )
    public  Object login( String username,String password,String code){
        System.out.println("account = " + username);
        System.out.println("password = " + password);
        System.out.println("code = " + code);
        return "username="+username+",password="+password+"，code="+code;
    }

    @PostMapping("register")
    public  Object regist(@RequestBody User user){
        System.out.println("user = " + user);
        return user;

    }

}
